package com.entity;

public class Category {
    private int cgId;
    private String cgName;
    private String cgDescription;
    private Integer cgFatherId;

    public int getCgId() {
        return cgId;
    }

    public void setCgId(int cgId) {
        this.cgId = cgId;
    }

    public String getCgName() {
        return cgName;
    }

    public void setCgName(String cgName) {
        this.cgName = cgName;
    }

    public String getCgDescription() {
        return cgDescription;
    }

    public void setCgDescription(String cgDescription) {
        this.cgDescription = cgDescription;
    }

    public Integer getCgFatherId() {
        return cgFatherId;
    }

    public void setCgFatherId(Integer cgFatherId) {
        this.cgFatherId = cgFatherId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Category category = (Category) o;

        if (cgId != category.cgId) return false;
        if (cgName != null ? !cgName.equals(category.cgName) : category.cgName != null) return false;
        if (cgDescription != null ? !cgDescription.equals(category.cgDescription) : category.cgDescription != null)
            return false;
        if (cgFatherId != null ? !cgFatherId.equals(category.cgFatherId) : category.cgFatherId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = cgId;
        result = 31 * result + (cgName != null ? cgName.hashCode() : 0);
        result = 31 * result + (cgDescription != null ? cgDescription.hashCode() : 0);
        result = 31 * result + (cgFatherId != null ? cgFatherId.hashCode() : 0);
        return result;
    }
}
